-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove CliNpmReqResolver
trait in deno_resolver
#27616
refactor: remove CliNpmReqResolver
trait in deno_resolver
#27616
Conversation
sys: self.sys(), | ||
in_npm_pkg_checker: self.in_npm_pkg_checker()?.clone(), | ||
node_resolver: self.node_resolver().await?.clone(), | ||
npm_req_resolver: npm_resolver.clone().into_npm_req_resolver(), | ||
npm_resolver: npm_resolver.clone().into_byonm_or_managed(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This into_...
is not ideal. I'll refactor the npm_resolver
stuff into an enum in the future and see about pushing more of the code down to deno_resolver.
#[class(inherit)] | ||
#[error(transparent)] | ||
ResolvePkgFolderFromPkgId(#[from] ResolvePkgFolderFromPkgIdError), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from below so it's not inbetween the struct and its implementation.
#[derive(Debug, thiserror::Error, deno_error::JsError)] | ||
pub enum ResolvePkgFolderFromPkgIdError { | ||
#[class(inherit)] | ||
#[error("{0}")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got rid of these and replaced with error(transparent)
match maybe_node_modules_path { | ||
Some(node_modules_folder) => new_rc(LocalNpmPackageResolver::new( | ||
resolution, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This struct is new. More stuff from the CLI will be moved down here in the future.
) -> Option<Ref<'a, V>> | ||
where | ||
K: std::borrow::Borrow<Q>, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this because I found the crate wasn't compiling again when the sync
feature isn't enabled. I think in the future we should add something to the CI to ensure all these crates compile without the sync
feature and in Wasm, but atm it's not high priority.
log::debug!( | ||
"Resolved {} from {} to {}", | ||
specifier, | ||
referrer, | ||
path.display() | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for these debug logs. Makes debugging so much easier!
No description provided.